package com.eddie.observer;

/**
 * @author Eddie
 * @date 2022/08/04 09:49
 **/
public class Client {
    public static void main(String[] args) {
        //创建一个weatherData
        WeatherData weatherData = new WeatherData();

        //创建观察者
        CurrentConditions currentConditions = new CurrentConditions();
        BaiduSite baiduSite = new BaiduSite();

        //注册到weatherData里
        weatherData.registerObserver(currentConditions);
        weatherData.registerObserver(baiduSite);
        weatherData.removeObserver(currentConditions);

        //通知各个注册的观察者
        System.out.println("~~~~~~~~~~~~~~~~~~~~~~~通知各个注册的观察者~~~~~~~~~~~~~~~~~~~~~~~");
        weatherData.setData(24,52,62);

    }
}
